import {
	TOKEN,
	LOGIN_USER_INFO
} from '@/config/constant'

export let setCache = (key, val) => uni.setStorageSync(key, val)

export let getCache = (key) => uni.getStorageSync(key)

export let getMyInfo = (key) => {
	let info = getCache(LOGIN_USER_INFO)
	if (!info) return {}
	return JSON.parse(info)
}

export let getToken = (key) => getCache(TOKEN)
